Carbon


OffsetRgn

Header: Quickdraw.h Carbon status: Supported

Moves a region.

void OffsetRgn (
     rgn, 
    SInt16 dh, 
    SInt16 dv
);
Parameter descriptions
rgn

A handle to the region to move.

dh

The horizontal distance to move the region.

dv

The vertical distance to move the region.

DISCUSSION

The OffsetRgn function moves the region whose handle you pass in the rgn parameter by adding the value you specify in the dh parameter to the horizontal coordinates of all points of its region boundary, and by adding the value you specify in the dv parameter to the vertical coordinates of all points of its region boundary. If the values of dh and dv are positive, the movement is to the right and down; if either is negative, the corresponding movement is in the opposite direction. The region retains its size and shape. This does not affect the screen unless you subsequently call a function to draw the region.

The OffsetRgn function is an especially efficient operation, because most of the data defining a region is stored relative to the rgnBBox field in its Region structure and so is not actually changed by OffsetRgn.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)